// JavaScript Document


function ctrlPriceInput (obj) {
	var value = obj.value;
	var newValue = '';
	
	var pointCnt = true;
	for (var i=0; i<value.length; i++) {
		if (/\d/.test(value.charAt(i))) {
			newValue += value.charAt(i);	
		} else {
			if (pointCnt && (value.charAt(i) == "." || value.charAt(i) == ",")) {
				newValue += ".";
				pointCnt = false;
			}
		} 
	}
	var pArr = newValue.split(".");
	if (pArr && pArr.length && pArr.length > 1) {
		newValue = pArr[0] + '.' + pArr[1].substr(0,2);
	} 
	obj.value = newValue;
}
